package com.zsn.ai.vo;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.ai.chat.messages.Message;

/**
 * @program: ai-demo
 * @ClassName MessageVO
 * @description:
 * @author: zsn
 * @create: 2025-09-24 09:15
 * @Version 1.0
 **/
@NoArgsConstructor
@Data
public class MessageVO {
    private String role;
    private String content;


    public MessageVO(Message message) {
        switch (message.getMessageType()){
            case USER:
                this.role = "user";
                break;
            case ASSISTANT:
                this.role = "assistant";
                break;
            default:
                this.role = "";
                break;
        }
        this.content = message.getText();
    }
}